package cn.yza.设计模式.装饰者模式.eg1;

/** 具体装饰者角色 存款装饰者
 *  动态地添加职责的对象。
 * @author Honglixi
 * @create 2021-11-02 13:33
 */
public class DepositDecoratorImpl extends AttachedPropertiesDecorator{
    private String deposit = "有存款";

    public DepositDecoratorImpl(Man man) {
        super(man);
    }

    public void addDeposit() {
        System.out.print(deposit + " ");
    }

    @Override
    public void getManDesc() {
        super.getManDesc();
        addDeposit();
    }
}